<%@ taglib prefix="s" uri="/struts-tags"%>
<link media="screen" type="text/css" href="../resources/css/style.css" rel="stylesheet">
<html>
<head>
<title>Books List</title>
</head>
<body>
 
<p>Books List</p>

<s:if test="books.size > 0">
	
	<table align="center" class="listing">
	    <tr><td class="hed" colspan="5">List of books</td></tr>
	    <tr>
	        <th>Title</th>
       		<th>Publisher</th>
        	<th>ISBN13</th>
        	<th>ISBN10</th>
        	<th>Authors</th>
	    </tr>
	   <s:iterator var="book"  value="books">
	    <tr <s:if test="book_index%2 = 0"></s:if>>
	        <td><s:property value="#book.title" /></td>
       	 	<td><s:property value="#book.publisher" /></td>
	        <td><s:property value="#book.ISBN13" /></td>
        	<td><s:property value="#book.ISBN10" /></td>
	        <td>
	        <ul>
 
		       <s:if test="#book.authors.size > 0">  
		          <s:iterator var="author"  value="#book.authors">
			         <li><s:property value="#author.firstName" /> <s:property value="#author.lastName" /></li>
			      </s:iterator>
		       </s:if> 
		       </ul>
	        </td>
	    </tr>
		</s:iterator>
		<tr>
		
	</table>
		
</s:if>
 
</body>
</html>